<template>
  <div>数字：{{ num }}</div>
  <button @click="add">+1</button>
  <button @click="dec">-1</button>
</template>

<script setup>
import { ref } from "vue";
    let num=ref(1);
    function add(){
        num.value++;
    }
    function dec(){
        num.value--;
    }

</script>

<style>

</style>